import { axios } from '@/utils/request'
import { ExcelDownLoad, WordDownLoad } from '@/myService/FileDownLoad'

let baseUrl="/data-governance/epidemicWeekly";

export default {
  getPeriodEpidemicOrder: function(params) {
    return axios({
      url: baseUrl + "/getPeriodEpidemicOrder",
      method: "GET",
      params: params
    })
  },
  categoryMergeStatistics: function(params){
    return axios({
      url: baseUrl + "/categoryMergeStatistics",
      method: "GET",
      params: params
    })
  },
  getPeriodPart2ByPeriodId: function(params){
    return axios({
      url: baseUrl + "/getPeriodPart2ByPeriodId",
      method: "GET",
      params: params
    })
  },
  getPeriodStatisticsById: function(periodId){
    return axios({
      url: baseUrl + "/getPeriodStatisticsById",
      method: "GET",
      params: {periodId:periodId}
    })
  },
  getPeriodStatistics: function(params){
    return axios({
      url: baseUrl + "/getPeriodStatistics",
      method: "GET",
      params: params
    })
  },
  editStatisticsCategoryAddNum: function(params){
    return axios({
      url: baseUrl + "/editStatisticsCategoryAddNum",
      method: "GET",
      params: params
    })
  },
  getStatisticsCategoryMerge: function(periodId){
    return axios({
      url: baseUrl + "/getStatisticsCategoryMerge",
      method: "GET",
      params: {periodId:periodId}
    })
  },
  mergeCategoryStatistics: function(data){
    return axios({
      url: baseUrl+"/mergeCategoryStatistics",
      method: "POST",
      data: data
    })
  },
  changeCategoryContent: function(params){
    return axios({
      url: baseUrl + "/changeCategoryContent",
      method: "GET",
      params: params
    })
  },
  getPeriodHandleOrderInfo: function(periodId){
    return axios({
      url: baseUrl + "/getPeriodHandleOrderInfo",
      method: "GET",
      params: {periodId:periodId}
    })
  },
  editHandleOrder: function(data){
    return axios({
      url: baseUrl+"/editHandleOrder",
      method: "POST",
      data: data
    })
  },
  delHandleOrderInfo:function(id) {
    return axios({
      url: baseUrl + "/delHandleOrderInfo",
      method: "GET",
      params: { id: id }
    })
  },
  generateSummary:function(params){
    return axios({
      url: baseUrl + "/generateSummary",
      method: "GET",
      params: params
    })
  },
  generateWord:function(params){
    return axios({
      url: baseUrl + "/generateWord",
      method: "GET",
      params: params,
      responseType:'blob',
    }).then(res => {
      WordDownLoad(res)
    })
  },
  getWord:function(params) {
    return axios({
      url: baseUrl + "/generateWord",
      method: "GET",
      params: params,
      responseType: 'blob',
    })
  },
  generateExcelOrderWeekly:function(params){
    return axios({
      url: baseUrl + "/generateExcelOrderWeekly",
      method: "GET",
      params: params,
      responseType: 'blob',
    }).then(res=>{
      ExcelDownLoad(res)
    })
  },
  getSummary: function(periodId){
    return axios({
      url: baseUrl + "/getSummary",
      method: "GET",
      params: { periodId:periodId }
    })
  }
}